package com.example.mapper;

import com.example.pojo.Feedback;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface FeedbackMapper {

    @Insert("insert into feedback(content,contact,created_at) values(#{content},#{contact},#{createdAt})")
    void add(Feedback feedback);

    List<Feedback> list();

    @Delete("delete from feedback where feedback_id = #{id}")
    void delete(Integer id);

    @Select("select * from feedback where feedback_id = #{id}")
    Feedback detail(Integer id);

    @Update("update feedback set content = #{content},contact = #{contact},created_at = #{createdAt} where feedback_id = #{feedbackId}")
    void update(Feedback feedback);
}
